// 生产环境
// export const baseUrlApi = (url: string) =>
//   process.env.NODE_ENV === "development"
//     ? `http://192.168.0.190:8080/${url}`
//     : `http://192.168.0.190:8080/${url}`;
// export const baseUrl = "http://192.168.0.190:8080/";

// // 开发环境
// export const baseUrlApi = (url: string) =>
//   process.env.NODE_ENV === "development"
//     ? `http://192.168.0.244:8080/${url}`
//     : `http://192.168.0.244:8080/${url}`;
// export const baseUrl = "http://192.168.0.244:8080/";

// 线上环境
// export const baseUrlApi = (url: string) =>
//   process.env.NODE_ENV === "development"
//     ? `http://yklink.net:58881/${url}`
//     : `http://yklink.net:58881/${url}`;
// export const baseUrl = "http://yklink.net:58881/";

// tool
// export const baseUrlApi = (url: string) =>
//   process.env.NODE_ENV === "development"
//     ? `http://192.168.0.101:8081/api/edgeGateway/v1/${url}`
//     : `http://192.168.0.101:8081/api/edgeGateway/v1/${url}`;
// export const baseUrl = "http://192.168.0.101:8081/api/edgeGateway/v1/";

// 动态接口
export const baseUrlApi = (url: string) =>
  process.env.NODE_ENV === "development"
    ? `http://${window.location.hostname}:8081/api/edgeGateway/v1/${url}`
    : `http://${window.location.hostname}:8081/api/edgeGateway/v1/${url}`;
export const baseUrl =
  "http://${window.location.hostname}:8081/api/edgeGateway/v1/";
